package com.qymerge.manage.core.bean;

/**
 * Created by chen.qiu on 2017/4/5.
 */
public class ActionResultRO<Data extends Object> implements java.io.Serializable {

    private boolean success;
    private String message;
    private Data resultMap;

    public ActionResultRO() {

    }

    public ActionResultRO(boolean success, String message, Data resultMap) {
        this.success = success;
        this.message = message;
        this.resultMap = resultMap;
    }

    public ActionResultRO(boolean success, String message) {
        this.success = success;
        this.message = message;
    }

    public ActionResultRO(int rn, String message) {
        this.success = rn==1;
        this.message = message;
    }

    public ActionResultRO(int rn, String successMsg, String errorMsg) {
        this.success = rn==1;
        this.message = rn==1?successMsg:errorMsg;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Data getResultMap() {
        return resultMap;
    }

    public void setResultMap(Data resultMap) {
        this.resultMap = resultMap;
    }
}
